<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="ISO-8859-1">
    <title>Student Management System</title>
    <link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/4.3.1/css/bootstrap.min.css">
    <!--    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/css/bootstrap.min.css" integrity="sha384-xOolHFLEh07PJGoPkLv1IbcEPTNtaed2xpHsD9ESMhqIYd0nLMwNLD69Npy4HI+N" crossorigin="anonymous">-->

</head>

<body>
<div class="container">
    <h1>Student Management System</h1>
    <hr>
    <h2>Update Student</h2>

    <form action="#" th:action="@{/saveStudent}" th:object="${student}" method="POST">

        <!-- Add hidden form field to handle update -->
        <input type="hidden" th:field="*{id}" />

        <input type="text" th:field="*{name}" class="form-control mb-4 col-4">

        <input type="text" th:field="*{grade}" class="form-control mb-4 col-4">

        <input type="text" th:field="*{age}" class="form-control mb-4 col-4">

        <input type="text" th:field="*{email}" class="form-control mb-4 col-4">

        <button type="submit" class="btn btn-info col-2"> Update Student</button>
    </form>

    <hr>

    <a th:href="@{/}"> Back to Student List</a>
</div>
</body>

</html>